<?php 
require_once('../mysqlUtil.php');
require_once('../islogin.php');
//获取请求参数
$id1=$_POST['id'];
$imagePath=$_POST['imagePath'];
$shopName=$_POST['shopName'];
$shopNum=$_POST['shopNum'];
$shopPrice=$_POST['shopPrice'];
$ShopState=$_POST['ShopState'];
$islimit=$_POST['islimit'];
$limitNumber=$_POST['limitNumber'];
//预处理及绑定
$sql = "UPDATE `php_shop_project`.`t_goods` SET  `name`=?, `num`=?, `price`=?, `state`=?, 
`islimit`=?, `limitNumber`=?,`imagePath`=? WHERE (`id`=?);";
$stmt=$conn->prepare($sql);
//设置参数并执行
$stmt->bind_param("sidiiisi",$shopName,$shopNum,$shopPrice,$ShopState,$islimit,$limitNumber,$imagePath,$id1);
$issuccess=$stmt->execute();
if($issuccess){ 
    echo json_encode(array('state' => true, 'msg' => '修改成功'));   
}else{
    echo json_encode(array('state' => true, 'msg' => 'error'));   
}

 
$conn->close();
?>